package com.inno.auth.infra.basic.service.impl;


import com.inno.auth.infra.basic.entity.PlannerMember;
import com.inno.auth.infra.basic.mapper.PlannerMemberDao;
import com.inno.auth.infra.basic.service.PlannerMemberService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;


/**
 * 会员信息表(PlannerMember)表服务实现类
 *
 * @author makejava
 * @since 2024-11-10 13:33:55
 */
@Service
public class PlannerMemberServiceImpl implements PlannerMemberService {
    @Resource
    private PlannerMemberDao plannerMemberDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public PlannerMember queryById(Long id) {
        return this.plannerMemberDao.queryById(id);
    }



    /**
     * 新增数据
     *
     * @param plannerMember 实例对象
     * @return 实例对象
     */
    @Override
    public PlannerMember insert(PlannerMember plannerMember) {
        this.plannerMemberDao.insert(plannerMember);
        return plannerMember;
    }

    /**
     * 修改数据
     *
     * @param plannerMember 实例对象
     * @return 实例对象
     */
    @Override
    public PlannerMember update(PlannerMember plannerMember) {
        this.plannerMemberDao.update(plannerMember);
        return this.queryById(plannerMember.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.plannerMemberDao.deleteById(id) > 0;
    }
}
